<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
    <link href="<s:url value="resources/css/main.css"/>" rel="stylesheet" type="text/css"/>
    <title><s:text name="label.payment.view"/></title>
</head>
<body>

<table align=center>
<tr><td><h1 ><s:text name="label.payment.view"/> </h1></td></tr>
</table>

<table align=center class="borderAll">
    <tr>
       <td colspan="2"> <s:text name="label.payment.view"/></th>
    </tr>
    <tr>
        <th><s:text name="label.payment.paymentType"/></th>
        <th><s:text name="label.payment.amount"/></th>
        <th><s:text name="label.payment.paymentDate"/></th>
        <th><s:text name="label.payment.checkNumber"/></th>
        <th><s:text name="label.payment.bankName"/></th>
        <th><s:text name="label.payment.branchName"/></th>
        <th><s:text name="label.payment.cleared"/></th>
        <th><s:text name="label.payment.creditCardNumber"/></th>
        <th><s:text name="label.payment.expireyDate"/></th>
        <th><s:text name="label.payment.creditCardType"/></th>

        <th>&nbsp;</th>
    </tr>
    <s:iterator value="payments" status="status">
        <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
            <td class="nowrap"><s:property value="paymentType"/></td>
            <td class="nowrap"><s:property value="amount"/></td>
            <td class="nowrap"><s:property value="paymentDate"/></td>
            <td class="nowrap"><s:property value="checkNumber"/></td>
            <td class="nowrap"><s:property value="bankName"/></td>
            <td class="nowrap"><s:property value="branchName"/></td>
            <td class="nowrap"><s:property value="cleared"/></td>

                 <td class="nowrap"><s:property value="creditCardNumber"/></td>
                 <td class="nowrap"><s:property value="expireyDate"/></td>
                 <td class="nowrap"><s:property value="creditCardType"/></td>

            <td class="nowrap">

            <s:if test="%{paymentType=='CASH'}">

                                        <s:url id="update" action="cashSetUpForUpdate">
                        		       		   <s:param name="payment.paymentId" value="paymentId"/>
                        		       		</s:url>
                                        <s:a href="%{update}">Edit</s:a>
                                        &nbsp;&nbsp;&nbsp;
                                        <s:url id="delete" action="cashDelete">
                        		       		    <s:param name="payment.paymentId" value="paymentId"/>
                        		       		</s:url>
                                        <s:a href="%{delete}">Delete</s:a>

            </s:if>
            <s:elseif test="%{paymentType=='CHECK'}">

                                                     <s:url id="update" action="checkSetUpForUpdate">
                                     		       		  <s:param name="check.paymentId" value="paymentId"/>
                                     		       		</s:url>
                                                     <s:a href="%{update}">Edit</s:a>
                                                     &nbsp;&nbsp;&nbsp;
                                                     <s:url id="delete" action="checkDelete">
                                     		       		    <s:param name="check.paymentId" value="paymentId"/>
                                     		       		</s:url>
                                                     <s:a href="%{delete}">Delete</s:a>
            </s:elseif>
            <s:else>

                                                                	<s:url id="update" action="creditCardSetUpForUpdate">
                                                   		       		<s:param name="creditCard.paymentId" value="paymentId"/>
                                                   		       		</s:url>
                                                                   <s:a href="%{update}">Edit</s:a>
                                                                   &nbsp;&nbsp;&nbsp;
                                                                   <s:url id="delete" action="creditDelete">
                                                   		       		 <s:param name="creditCard.paymentId" value="paymentId"/>
                                                   		       		</s:url>
                                                                   <s:a href="%{delete}">Delete</s:a>


            </s:else>




            </td>

        </tr>  		
	 </s:iterator>
    </table>

